import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import {
  updateBindSessionH5,
  saveCorpAndCheckVerification,
  getAuthUrlH5,
  updateBindCorpH5,
  getScanResultH5,
  checkAppIdNumH5,
} from '../../api/h5';
const router = new Router();

// 注册并登陆接口
router.get('/updateBindSession', async ctx => {
  const response = await proxyService.postProxy(ctx, updateBindSessionH5);
  return (ctx.body = response);
});

router.get('/updateBindCorpH5', async ctx => {
  const response = await proxyService.postProxy(ctx, updateBindCorpH5);
  return (ctx.body = response);
});

router.get('/getAuthUrlH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getAuthUrlH5);
  return (ctx.body = response);
});

router.get('/getScanResultH5', async ctx => {
  const response = await proxyService.postProxy(ctx, getScanResultH5);
  return (ctx.body = response);
});

router.get('/checkAppIdNumH5', async ctx => {
  const response = await proxyService.postProxy(ctx, checkAppIdNumH5);
  return (ctx.body = response);
});
router.get('/saveCorpAndCheckVerification', async ctx => {
  const response = await proxyService.postProxy(ctx, saveCorpAndCheckVerification);
  return (ctx.body = response);
});

export default router;
